<template>
    <div class="table_c">
        <el-table
        :data="tableData"
        :height="height"
        style="width: 100%" cell-class-name ="cell_s" :show-header="show" @row-click = "detail">

            <el-table-column
                v-for="(item, index) in tableLabel"
                :key="index" 
                :prop="item.prop" 
                :width="item.width" 
                :label="item.label"  show-overflow-tooltip fit>
            </el-table-column>

        </el-table>
    </div>
</template>

<script>
    export default {
        props: {
            height:200,
            tableData: { // 父组件传递过来的表格数据
                    type: Array,
                    default: []
                },
                tableLabel: { // 父组件传递过来的表头数据
                    type: Array,
                    default: () => {
                        return []
                    }
                },
                show:Boolean

        },
        data() {
            return {
                
            }
        },
        methods: {
            detail(	row, event, column){
                // console.log(row, event, column)
                this.$emit("childTable",row);
            },
        },
    }
</script>

<style lang="scss" scoped>
    .table_c /deep/ .cell_s{
        // height: 30px;
        padding: 8px 0;
        border-bottom: none;
        cursor: pointer;
    }
    .table_c /deep/ .is-leaf{
        color: #cc1309;
        padding: 8px 0;
        border-bottom: none;
    }    
     .table_c /deep/ .el-table::before{
         height: 0px;
     }
</style>